import { BrowserWindow, screen } from 'electron';
import { WINDOW_WIDTH } from '../constance/screen';

class AppInteractive {
    window: BrowserWindow | null = null;

    public hiddenWindow() {
        this.window?.hide();
    }

    public setAppPosition() {
        if (!this.window) return;
        const primaryScreen = screen.getPrimaryDisplay().workAreaSize;
        this.window.setPosition(primaryScreen.width - WINDOW_WIDTH, 70);
        this.window.setAlwaysOnTop(true);
    }

    public init(mainWindow: BrowserWindow) {
        this.window = mainWindow;

        this.hiddenWindow();
        this.setAppPosition();
    }
}

export default new AppInteractive();
